{% extends "managersys/base/base_page.html" %}
{% load staticfiles %}
{% block content %}
    <div class="content">
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-12">
                    <div class="card">
                        <div class="content">
                            <div class="row">
                                <form id="allInputsFormValidation" class="form-horizontal"
                                      action="{% url 'managersys:editbook' id=book.id %}"
                                      method="post"
                                      novalidate="">
                                    <div class="col-md-4 col-sm-4">
                                        <legend>封面</legend>
                                        <div class="fileinput fileinput-new text-center" data-provides="fileinput">
                                            <div class="fileinput-new thumbnail">
                                                <img src="{% static book.image_url %}" alt="...">
                                            </div>
                                            <div class="fileinput-preview fileinput-exists thumbnail"></div>
                                            <div>
                                                    <span class="btn btn-default btn-fill btn-file">
                                                        <span class="fileinput-new">Select image</span>
                                                        <span class="fileinput-exists">Change</span>
                                                        <input type="file" name="image"/>
                                                    </span>
                                                <a href="#pablo" class="btn btn-danger btn-round fileinput-exists"
                                                   data-dismiss="fileinput"><i class="fa fa-times"></i> Remove</a>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-8">
                                        {% csrf_token %}
                                        <div class="content">
                                            <h4 class="title">图书信息</h4>
                                            <fieldset>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">
                                                        书名
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control"
                                                               type="text"
                                                               name="name"
                                                               required="required"
                                                               value="{{ book.name }}"
                                                        />
                                                    </div>
                                                </div>
                                            </fieldset>

                                            <fieldset>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">
                                                        作者
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control"
                                                               type="text"
                                                               name="author"
                                                               required="required"
                                                               value="{{ book.author }}"
                                                        />
                                                    </div>
                                                </div>
                                            </fieldset>

                                            <fieldset>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">
                                                        ISBN
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control"
                                                               type="text"
                                                               name="ISBN"
                                                               number="true"
                                                               value="{{ book.ISBN }}"
                                                        />
                                                    </div>
                                                </div>
                                            </fieldset>
                                            <fieldset>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">
                                                        位置
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control"
                                                               type="text"
                                                               name="location"
                                                               number="true"
                                                               value="{{ book.location }}"
                                                        />
                                                    </div>
                                                </div>
                                            </fieldset>
                                            <fieldset>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">
                                                        出版日期
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control"
                                                               type="text"
                                                               name="publishdate"
                                                               required="required"
                                                               value="{{ book.publish_date }}"

                                                        />
                                                    </div>
                                                </div>
                                            </fieldset>

                                            <div class="card-footer text-center">
                                                <button type="submit" class="btn btn-info btn-fill">修改</button>
                                            </div>
                                        </div>
                                </form>

                            </div>


                        </div>
                    </div>
                </div>
                <!-- end card -->
            </div>
        </div>
    </div>
    </div>
{% endblock %}
{% block pagescript %}

{% endblock %}

